import { observable, action } from 'mobx'
import * as api from 'lib/constants/api'
import { post } from 'lib/net'
import Toast from 'components/toast'
import Load from 'components/load'

// class AddressModel {
//   constructor (data) {
//     if (data) {
//     }
//   }
// }

export default class AchievementVM {
  constructor (props) {
    this.props = props
    this.PageInitialization()
  }

 // 获取业绩流水
  @observable orderRecord = []

 // 业绩流水
  @observable record = false

  @action PageInitialization = async () => {
    this.test = '9999999'
    Load.loading(1, '加载中')
    let Id = this.props.history.location.search.split('?')[1]
    let response = await post(api.GETORDERRECORD, { Id: Id })
    if (response.Success) {
      this.record = true
      Load.loading(2, '加载完成')
      this.orderRecord = response.Value
    } else {
      Toast.fail(response.Message)
    }
  }
}
